package com.ztx.service.manager.impl;

import java.util.List;

import javax.annotation.Resource;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;

import com.ztx.model.JklsVO;
import com.ztx.model.JklsViewVO;
import com.ztx.pagemodel.easyui.DataGrid;
import com.ztx.pagemodel.easyui.PageHelper;
import com.ztx.service.manager.IJklsService;

@Repository(IJklsService.BEAN_ID)
public class JklsServiceImpl implements IJklsService {

	@Resource
	private SqlSessionTemplate sqlSessionTemplate = null;

	
	@Override
	public DataGrid<JklsVO> queryJkls(PageHelper ph, JklsViewVO params) {
		long total = sqlSessionTemplate.selectOne(JklsVO.class.getName()
				+ ".queryJklsCount");
		List<JklsVO> list = sqlSessionTemplate.selectList(
				JklsVO.class.getName() + ".queryJkls", params,
				ph.getRowBounds());
		DataGrid<JklsVO> datagrid = new DataGrid<JklsVO>();
		datagrid.setTotal(total);
		datagrid.setRows(list);
		return datagrid;
	}

}
